-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 9918 #9932
Fix 9918 #9932
Conversation
@@ -486,22 +486,26 @@ def serving(self, inputs): | |||
|
|||
(a) For sequence pairs (for a pair title+text for example): | |||
|
|||
``tokens: [CLS] is this jack ##son ##ville ? [SEP] no it is not . [SEP]`` | |||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That docstring had been changed to work around the doc-styling failure. This makes it the same as the PyTorch one,
def end_of_special_style(self, line): | ||
""" | ||
Sets back the `in_block` attribute to `NOT_SPECIAL`. | ||
|
||
Useful for some docstrings where we may have to go back to `ARG_LIST` instead. | ||
""" | ||
self.in_block = SpecialBlock.NOT_SPECIAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically the problem was that when a code block was nested in the argument list, we were returning to a not special style instead of returning to an arg list style. This new method overriden in the subclass DocStyler
ensures we return to the proper type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for updating all of these! LGTM!
What does this PR do?
This PR addresses the problem shown in #9918 by:
encode
method to thePreTrainedTokenizer
andPreTrainedTokenizerFast
(it is in all their subclasses already)In passing, I uncovered a failure of the doc styling script on DPR, so this PR also fixes that.
Fixes #9918